<?php

class set_code_handler extends _site_handler {
	public function __construct($m, $view) {
		$this->InitializeSite($m);

		if ( isset($_GET['code']) ) $this->SetPref(array('code' => $_GET['code']));

		if ( $this->Ajax ) {
			// Success view template?
		} else {
			$back_url = ( isset($_GET['back_url']) ) ? $_GET['back_url'] : '/';

			header("Location: " . $back_url);
		}
	}
}
